home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20031118-20041115 / 000027_fdc@columbia.edu_Mon Dec 1 11:43:53 2003.msg < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Path: newsmaster.cc.columbia.edu!not-for-mail
  2. From: Frank da Cruz <fdc@columbia.edu>
  3. Newsgroups: comp.protocols.kermit.misc
  4. Subject: Re: Problem in Kermit trying to get a file while sending it at the same time
  5. Date: 1 Dec 2003 16:43:26 GMT
  6. Organization: Columbia University
  7. Lines: 48
  8. Message-ID: <slrnbsmrte.pqg.fdc@sesame.cc.columbia.edu>
  9. References: <f0bb0f39.0311250532.1b93aad@posting.google.com> <slrnbs6r9i.oig.fdc@sesame.cc.columbia.edu> <f0bb0f39.0311260731.11d9eb29@posting.google.com> <f0bb0f39.0311261025.6fd175b5@posting.google.com> <slrnbsa0at.dm1.fdc@sesame.cc.columbia.edu> <f0bb0f39.0312010625.7751d0a7@posting.google.com>
  10. Reply-To: fdc@columbia.edu
  11. NNTP-Posting-Host: sesame.cc.columbia.edu
  12. X-Trace: newsmaster.cc.columbia.edu 1070297006 13666 128.59.59.56 (1 Dec 2003 16:43:26 GMT)
  13. X-Complaints-To: postmaster@columbia.edu
  14. NNTP-Posting-Date: 1 Dec 2003 16:43:26 GMT
  15. User-Agent: slrn/0.9.7.4 (SunOS)
  16. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:14703
  17.  
  18. In article <f0bb0f39.0312010625.7751d0a7@posting.google.com>,
  19. newexpectuser wrote:
  20. :
  21. : (quoting from http://www.columbia.edu/kermit/ftpscripts.html):
  22. : "...Now we can move the uploaded file from the server's working directory
  23. : to its ready directory (the syntax assumes a UNIX-like file system on
  24. : server):
  25. :   ftp rename \m(nameonly) ../ready/\m(nameonly)"
  26. : This solves my problem if I have a partial file, it will be transfered
  27. : into a directory (working) where my central-site server won't be
  28. : looking for it. Once this file has been dropped off 100%, then the
  29. : next time around I run to send files, I will then pickup a full file
  30. : in my working directory.
  31. : What I don't understand is with the above "ftp rename \m(nameonly)
  32. : ../ready/\m(nameonly)", how does this avoid moving the partial file
  33. : from the working directory to the ready directory, there will still be
  34. : a file in the working directory albeit a partial file and this command
  35. : will move it along to the ready directory.
  36. The lines preceding the "ftp rename" command are:
  37.  
  38.   ftp put /delete \m(filename)
  39.   if fail exit 1 ftp put \m(filename): \v(ftp_message)
  40.  
  41. Thus the "ftp rename" command won't be reached if "ftp put" fails.
  42. This is exactly the reason that we recommend that each critical step
  43. be checked with IF FAIL -- you don't want the script to proceed in
  44. cases where the subsequent commands require the preceding ones to
  45. succeed.
  46.  
  47. Of course conditional command in the IF statement need not be EXIT; it
  48. can be anything you want, even a series of commands, e.g.:
  49.  
  50.   if fail {
  51.       command1
  52.       command2
  53.       ...
  54.   } else {        ; The ELSE part is optional
  55.       command1
  56.       command2
  57.       ...
  58.   }
  59.  
  60. - Frank
  61.